import Vue from 'vue'
import ECharts from 'vue-echarts'
import VueKonva from 'vue-konva'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import App from './App.vue'
import router from './router'
import VueHtmlToPaper from 'vue-html-to-paper';
import VueLocalStorage from 'vue-local-storage'
import axios from 'axios'
import JsonViewer from 'vue-json-viewer'



Vue.use(ElementUI)
Vue.use(VueKonva)
Vue.use(VueLocalStorage)
Vue.use(JsonViewer)


import "echarts";
Vue.component('v-chart', ECharts)

import CsRuler from 'cs-ruler'
Vue.use(CsRuler)


axios.defaults.baseURL = process.env.VUE_APP_API_URL
axios.interceptors.request.use(request => {
  let authData = VueLocalStorage.get('authDataKey')
  if (authData) {
    // console.log('authData:', authData)
    request.headers.Authorization = authData.token
  }
  return request
})

const options = {
  name: '_blank',
  specs: [
    'fullscreen=yes',
    'titlebar=yes',
    'scrollbars=yes'
  ],
  styles: [
    // 'https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css',
    // 'https://unpkg.com/kidlat-css/css/kidlat.css',
  ]
}
Vue.use(VueHtmlToPaper, options);


new Vue({
  el: '#app',
  router,
  render: h => h(App)
})
